package com.bruip.spring.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

/**
 * @author 王若龙
 * @CreateTime 2022-08-30 15:54
 */
@Data
@AllArgsConstructor

public class User {

    private Integer id;

    private String name;

    private String password;

    private Integer age;

    public User() {
        System.out.println("生命周期1：实例化");
    }


    public void setId(Integer id) {
        System.out.println("生命周期2：依赖注入");
        this.id = id;
    }

    public void init(){
        System.out.println("生命周期3：初始化");
    }

    public void destroy() {
        System.out.println("生命周期4：销毁");
    }

}
